﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LotteryVote.Logic.Exceptions;

namespace LotteryVote.Logic.Web
{
    public class MemberControl : AuthorizeControl
    {
        protected override void CheckRole()
        {
            Execute(() =>
            {
                if (!IsLogin)
                    Response.Redirect("Login.aspx?ReturnUrl=" + Request.RawUrl);
                if (CurrentUser.Role != IdentityRole)
                    throw new NoPermissionException("没有访问权限!");
            });
        }
    }
}
